<!--#include file="functions.asp" -->

<%
  'set cn=Server.CreateObject("ADODB.Connection")
  'cn.Open "MP2ENTTEST2", "MP2", "MP2"
  
  sql = "SELECT T0, T1, T2 FROM EXIRULES WHERE "
  sql = sql & "T0='" & request.querystring("T0") &"'"
  if (request.querystring("T1")<>"") then
  sql = sql & " AND T1='" & request.querystring("T1") &"'"
  end if
  if (request.querystring("T2")<>"") then
  sql = sql & " AND T2='" & request.querystring("T2") &"'"
  end if
  set rs=cn.execute(sql)
  
  if rs.eof then
%>
<SCRIPT language="JavaScript">
//window.opener.<%= request.querystring("fld")%>.value='';
//window.opener.<%= request.querystring("fld2")%>.value='';
var url_source="error_msg.html";
var arg="T0,T1 and T2 Code Not Match!!!";
var modal_dim="dialogWidth:360px; dialogHeight:160px; center:yes; status:no; location:no;";
var x = window.showModalDialog(url_source,arg,modal_dim);
window.opener.<%= request.querystring("src")%>.focus();
window.opener.<%= request.querystring("src")%>.select();
window.close();
</SCRIPT> 


<%
  else
  'Do While Not rs.EOF
  'empName=rs("FIRSTNAME")& " " & rs("LASTNAME")
  'dept=rs("DEPARTMENT")
  'rs.MoveNext
  'Loop
  
  Set rs = Nothing
%>
<SCRIPT language="JavaScript">
//var querystring = '<%= request.querystring("fld")%>' ;

//window.opener.<%= request.querystring("fld")%>.value='<%= empName %>';
//window.opener.<%= request.querystring("fld2")%>.value='<%= dept %>';
//window.opener.<%= request.querystring("fld")%>.focus();
window.close();

</SCRIPT>
<% end if %>

